home *** CD-ROM | disk | FTP | other *** search
/ Workplace Effectiveness:…ecision-Making Strategies / Workplace Effectiveness: Decision-Making Strategies.iso / pc / Alliance.dxr / 00003_Alliance parent.ls < prev    next >
Encoding:
Text File  |  1998-12-04  |  4.9 KB  |  196 lines

  1. property module, userArea, usedList, soundList, musicStart, musicTime, musicChoice
  2.  
  3. on new me
  4.   set the userArea of me to #empty
  5.   set the usedList of me to [#main: [#video: 0], #menu1: [#menu1: 0, #myself: 0, #measure: 0, #history: 0, #mirror: 0], #menu2: [#menu2: 0, #dm101: 0, #reach4: 0, #stepfar: 0, #view: 0], #menu3: [#menu3: 0, #dm202: 0, #meeting: 0, #candles: 0, #whowhat: 0], #menu4: [#menu4: 0, #review: 0, #plan: 0, #eval: 0, #video: 0]]
  6.   set the soundList of me to [#main: [], #menu1: [], #menu2: [], #menu3: [], #menu4: []]
  7.   set the musicChoice of me to 1
  8.   return me
  9. end
  10.  
  11. on setModule me, thisModule
  12.   set the module of me to thisModule
  13. end
  14.  
  15. on setUserArea me, thisActivity
  16.   set the userArea of me to thisActivity
  17. end
  18.  
  19. on getUserArea me
  20.   return the userArea of me
  21. end
  22.  
  23. on setSoundList me, thisList
  24.   if getProp(the soundList of me, the module of me) = [] then
  25.     setProp(the soundList of me, the module of me, thisList)
  26.   end if
  27. end
  28.  
  29. on activate me, thisArea
  30.   set vParams to the paramCount
  31.   case vParams of
  32.     1:
  33.       setProp(getProp(the usedList of me, the module of me), the userArea of me, 1)
  34.     2:
  35.       setProp(getProp(the usedList of me, the module of me), thisArea, 1)
  36.   end case
  37. end
  38.  
  39. on iAmActivated me
  40.   return getProp(getProp(the usedList of me, the module of me), the userArea of me)
  41. end
  42.  
  43. on activationOn me, thisArea, thisModule
  44.   set vParams to the paramCount
  45.   case vParams of
  46.     2:
  47.       return getProp(getProp(the usedList of me, the module of me), thisArea)
  48.     3:
  49.       return getProp(getProp(the usedList of me, thisModule), thisArea)
  50.   end case
  51. end
  52.  
  53. on goNarrator me, thisItem
  54.   sound playFile 2, "@//Media/Sound/" & thisItem & ".aif"
  55. end
  56.  
  57. on diskAudio me, thisItem
  58.   sound playFile 2, "@//Media/Sound/" & thisItem & ".aif"
  59. end
  60.  
  61. on audio1xOnly me, thisItem
  62.   if getPos(getProp(the soundList of me, the module of me), thisItem) = 0 then
  63.     sound playFile 2, "@//Media/Sound/" & thisItem & ".aif"
  64.     add(getProp(the soundList of me, the module of me), thisItem)
  65.   end if
  66. end
  67.  
  68. on clearSoundUsage me, stringList
  69.   repeat with vSound in stringList
  70.     deleteOne(getProp(the soundList of me, the module of me), vSound)
  71.   end repeat
  72. end
  73.  
  74. on checkMusic me
  75.   if not (the musicChoice of me) then
  76.     exit
  77.   end if
  78.   if not soundBusy(2) then
  79.     bkgrdMusic(me)
  80.   end if
  81. end
  82.  
  83. on bkgrdMusic me
  84.   if not (the musicChoice of me) then
  85.     exit
  86.   end if
  87.   set thisItem to #empty
  88.   case the module of me of
  89.     #main:
  90.       set thisItem to "Trac25"
  91.     #menu1:
  92.       case the userArea of me of
  93.         #menu1:
  94.           set thisItem to "Trac28b"
  95.         #myself:
  96.           set thisItem to "Trac35t"
  97.         #measure:
  98.           set thisItem to "Trac32w"
  99.         #history:
  100.           set thisItem to "Trac29l"
  101.         #mirror:
  102.           set thisItem to "Trac30a"
  103.       end case
  104.     #menu2:
  105.       case the userArea of me of
  106.         #menu2:
  107.           set thisItem to "Trac28b"
  108.         #dm101:
  109.           set thisItem to "Trac31s"
  110.         #reach4:
  111.           set thisItem to "Trac39f"
  112.         #stepfar:
  113.           set thisItem to "Trac33s"
  114.         #view:
  115.           set thisItem to "Trac34i"
  116.       end case
  117.     #menu3:
  118.       case the userArea of me of
  119.         #menu3:
  120.           set thisItem to "Trac28b"
  121.         #dm202:
  122.           set thisItem to "Trac31s"
  123.         #meeting:
  124.           set thisItem to "Trac32w"
  125.         #candles:
  126.           set thisItem to "Trac37l"
  127.         #whowhat:
  128.           set thisItem to "Trac36m"
  129.       end case
  130.     #menu4:
  131.       set thisItem to "Trac31s"
  132.       case the userArea of me of
  133.         #menu4:
  134.           set thisItem to "Trac31s"
  135.         #review:
  136.           set thisItem to "Trac28b"
  137.         #plan:
  138.           set thisItem to "Trac32w"
  139.         #eval:
  140.           set thisItem to "Trac37l"
  141.       end case
  142.   end case
  143.   if thisItem <> #empty then
  144.     musicSpecs(me, thisItem)
  145.     sound playFile 2, "@//Media/" & thisItem & ".aif"
  146.   end if
  147. end
  148.  
  149. on musicSpecs me, trackName
  150.   case trackName of
  151.     "Trac25":
  152.       set the musicTime of me to 60 * 130
  153.     "Trac27g":
  154.       set the musicTime of me to 60 * 70
  155.     "Trac28b":
  156.       set the musicTime of me to 60 * 305
  157.     "Trac29l":
  158.       set the musicTime of me to 60 * 82
  159.     "Trac30a":
  160.       set the musicTime of me to 60 * 123
  161.     "Trac31s":
  162.       set the musicTime of me to 60 * 108
  163.     "Trac32w":
  164.       set the musicTime of me to 60 * 99
  165.     "Trac33s":
  166.       set the musicTime of me to 60 * 241
  167.     "Trac34i":
  168.       set the musicTime of me to 60 * 65
  169.     "Trac35t":
  170.       set the musicTime of me to 60 * 123
  171.     "Trac37l":
  172.       set the musicTime of me to 60 * 122
  173.     "Trac39f":
  174.       set the musicTime of me to 60 * 60
  175.   end case
  176.   set the musicStart of me to the ticks
  177. end
  178.  
  179. on switchMusic me
  180.   if the musicChoice of me then
  181.     set the musicChoice of me to 0
  182.     if soundBusy(2) then
  183.       sound stop 2
  184.     end if
  185.   else
  186.     set the musicChoice of me to 1
  187.   end if
  188. end
  189.  
  190. on showProperties me
  191.   put "module:" && the module of me
  192.   put "userArea:" && the userArea of me
  193.   put "usedList:" && the usedList of me
  194.   put "soundList:" && the soundList of me
  195. end
  196.